package com.yzh.IOCDI.repository;

import com.yzh.IOCDI.component.UserComponent;
import com.yzh.IOCDI.service.UserSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserRepository {
    public void doRepository(){
        // @Repository：数据访问层，也称为持久层. 负责数据访问操作
        System.out.println("doRepository--");
    }
    private UserSevice userSevice;

    @Autowired
    public UserRepository(UserSevice userSevice){
        this.userSevice = userSevice;
    }
    private UserComponent userComponent;
    public UserRepository(UserSevice userSevice, UserComponent userComponent){
        this.userSevice = userSevice;
        this.userComponent = userComponent;
    }
}
